// write stuff to load entities (instance_create(), etc)
var loadedEntity;
loadedEntity = false;
while(!loadedEntity)
{
    entTag = readLine();
    switch(entTag.name)
    {
        case "entity_id":
            _eid = findEntityById(entTag.sval);
        break;
        
        case "sprite":
            _artsprite = sprite_get_index(entTag.sval);
        break;
        
        case "x":
            _x = real(entTag.sval);
        break;
        
        case "y":
            _y = real(entTag.sval);
        break;
        
        case "rotation":
            _imageangle = real(entTag.sval);
        break;
        
        case "/entity":
            loadedEntity = true;
        break;
    }
    if (!loadedEntity)
    {
        nextLine();
    }
}


ins = instance_create(_x, _y, Entity);
ins.sprite_index = _artsprite;
ins.image_angle = _imageangle;
if (_eid != noone)
{
    ins.entity = _eid;
}

